package com.training.bt.common;

import java.util.HashMap;
import java.util.Map;

public class ApiResponse {
    private String status;
    private String message;
    private Map<String, Object> data = new HashMap<>();

    public ApiResponse(String status, String message) {
        this.status = status;
        this.message = message;
    }

    public static ApiResponse success(String message) {
        return new ApiResponse("success", message);
    }

    public static ApiResponse error(String message) {
        return new ApiResponse("error", message);
    }

    public ApiResponse addData(String key, Object value) {
        this.data.put(key, value);
        return this;
    }

    // getters and setters
    public String getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

    public Map<String, Object> getData() {
        return data;
    }
}